<template>
  <div>
    <div class="second_nav">
      <ul>
        <li
          @click="nav1(index+1)"
          @mouseover="onMouseOver1(index)"
          @mouseout="onMouseout1(index)"
          v-for="(item,index) of nav"
          :key="index"
        >
          <!-- <router-link :to="base"> -->
          <!-- <img src="../assets/image//patten_blue.png" alt /> -->
          <img src="../assets/image/patten.png" alt />

          <p class="white" :class="{p_color:choose==index}">{{item.name}}</p>
          <!-- </router-link> -->
        </li>
      </ul>
    </div>
    <div></div>
  </div>
</template>
<script>
export default {
  name: "show",
  data() {
    return {
      choose: 9,
      seen: false,
      nav: [
        { name: "活动预告" },
        { name: "文博课堂" },
        { name: "文博讲座" },
        { name: "青少年活动" },
      ],
    };
  },

  methods: {
    nav1(i) {
      this.choose = i;
      this.$emit("childByvalue5", this.seen);

      if (i == 1) {
        this.$router
          .push({
            path: "/huodongyugao/huodongyugao2/:id",
            query: { orderId: "活动预告", bool: true },
          })
          .catch((err) => {
            err;
          });
      } else if (i == 3) {
        this.$router
          .push({
            path: "/huodongyugao/wenbojiangzuo/:id",
            query: { orderId: "文博讲座", bool: true },
          })
          .catch((err) => {
            err;
          });
      }
      if (i == 2 || i == 4) {
        if (i == 2) {
          this.sort = "wenboketang";
          this.orderId = "文博课堂";
        } else if (i == 4) {
          this.sort = "qingshaonianhuodong";
          this.orderId = "青少年活动";
        }
        this.$router
          .push({
            path: "/huodongyugao/wenboketang/:id",
            query: { orderId: this.orderId, ketang: this.sort },
          })
          .catch((err) => {
            err;
          });
      }
    },

    onMouseOver1(i) {
      this.choose = i;
    },
    onMouseout1(i) {
      this.choose = 9;
    },
  },
  components: {},
  mounted() {},
};
</script>
<style scoped>
.second_nav {
  width: 100%;
  height: 50px;
  background: rgb(78, 104, 161);
  border-top: 5px solid rgb(0, 54, 103);
  box-sizing: border-box;
  padding: 0px 584px 0px;
  position: absolute;
  top: 100px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  z-index: 10000;
}
.second_nav ul {
  display: flex;
  /* width: 100%; */
  height: 30px;
  justify-content: center;
  position: absolute;
  top: 0px;
  left: 350px;
  right: 0px;
  bottom: 0px;
  margin: auto;
}
.second_nav ul li {
  margin: 0 7px 0px;
}
.second_nav ul li:first-child img {
  display: none;
}
.second_nav ul li p {
  font-size: 16px;
  width: 80px;
}
.second_nav ul li img {
  margin-right: 15px;
}
.white {
  /* font-size:24px; */
  font-size: 14px;
  color: white;
}
.second_nav ul li a {
  color: white;
  margin-right: 60px;
  width: 150px;
  font-size: 18px;
  color: white;
  display: flex;
}
.second_nav ul li {
  display: flex;
  justify-content: center;
  align-items: center;
}
li {
  list-style: none;
  text-align: center;
  cursor: pointer;
}
ul,
p {
  margin: 0px;
  padding: 0px;
}
.p_color {
  color: rgb(0, 54, 103);
}

a {
  text-decoration: none;
}
</style>